﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom.Compiler;

namespace RobotBattle2.Scripting {
	public sealed class IndexerExpression : Expression {
		public IndexerExpression() { }

		public IndexerExpression(Expression target, Expression index) {
			this.Target = target;
			this.Index = index;
		}

		public Expression Target { get; set; }

		public Expression Index { get; set; }

		public override void Dump(IndentedTextWriter writer) {
			Target.Dump(writer);
			writer.Write('[');
			Index.Dump(writer);
			writer.Write(']');
		}

		public override ExpressionType Type { get { return ExpressionType.Indexer; } }
	}
}
